package com.wenhai.spring.bean.definition;

import com.wenhai.xiaomage.spring.ioc.overview.dependency.domain.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author:wenhai
 * @Description: Bean 别名示例
 * @Date:2020/3/24
 */
public class BeanAliasDemo {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/META-INF/bean-definition-context.xml");
        User user = User.class.cast(applicationContext.getBean("wenhai-user",1L));
        System.out.println(user);
    }
}
